setTimeout(keepAlive,KEEP_ALIVE);
/*    
Ext.Msg.buttonText.ok=_('Ok');    
Ext.Msg.buttonText.yes=_('Yes');
Ext.Msg.buttonText.no=_('No');
Ext.Msg.buttonText.cancel=_('Cancel');
*/
function renderUserDate(value){
	if (value!="" && value!="0000-00-00 00:00:00") {
		offset = (userLocale/100);
		utcdate = new Date(value.substr(0,4), value.substr(5,2)-1, value.substr(8,2), value.substr(11,2), value.substr(14,2), value.substr(17,2)).getTime();
		userdate = new Date(utcdate + (3600000*offset));
	    return Ext.util.Format.date(userdate,userDateFormat);
	} else {
		return "";
	}
}


function translate(value){
	res = "";
	if (DEFTRANS[value]!=null)	res = DEFTRANS[value];
    return res;
}

function statusRender(value) {
	var rand_no = Math.random();
	return "<img src='images/status/" + value + ".png ' align='top' border='0' height='' width=''/> " + translate(value);
}

function fileErrorRender(value, p, record) {
	switch (record.data.statusId) {
		case FILE_UPLOAD_OK:
			res = "grid-up-icon-ok";
			break;
		case FILE_UPLOAD_FAIL:
			res = "grid-up-icon-failed";
			break;
		default:
			res = "";
			break;
	}
	return String.format("<span class=\"{0}\">{1}</span>",res,value);
}

function getStatusFilter() {
	return [{id: FILE_STATUS_TODO, text: statusRender(FILE_STATUS_TODO)},
			{id: FILE_STATUS_LOCKED, text: statusRender(FILE_STATUS_LOCKED)},
			{id: FILE_STATUS_TRANS, text: statusRender(FILE_STATUS_TRANS)},
			{id: FILE_STATUS_CHKPND, text: statusRender(FILE_STATUS_CHKPND)},
			{id: FILE_STATUS_PROOF, text: statusRender(FILE_STATUS_PROOF)},
			{id: FILE_STATUS_CMPND, text: statusRender(FILE_STATUS_CMPND)},
			{id: FILE_STATUS_DONE, text: statusRender(FILE_STATUS_DONE)}];
}

function getPageSizeList() {
	return [25,50,75,100,150,200,500];
}

function confirm(title, fnYES, fnNO, scope) {
    Ext.Msg.confirm(_('Confirm'),
     title, function(btn) {
         	if (btn=="yes") {
				if (fnYES!=undefined) {
					fnYES.call(scope || null);
				}	
 			} else {
				if (fnNO!=undefined) {
					fnNO.call(scope || null);
				} 
 			}
		} 
	);	
}

/*
Verbum.Msg = function(){
        f = function() {}
        f.prototype = Ext.MessageBox;
        var o = function() {}
        Ext.extend(o,f, function(){
            return {
                 getDialog : function() {
	                 var d = o.superclass.getDialog.apply(this, arguments);
	                 //d.modal=false;
	                 //d.manager = new Ext.WindowGroup(9999);
	                 //d.modal=false;
	                 return d;
	            },

	            show : function(options) {
	            	var x = o.superclass.show.call(this, options);
	                return x;
	            } 
      		};        
 		}());
		return new o();
 }();*/


